import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/components/PageLayout.vue'
import homeLayout from '@/components/homeLayout.vue'

const routes = [
  {
    path: '/',
    redirect: '/home',
    component: Layout,
    mate: {
      title: '首页'
    },
    children: [
      {
        path: '/home',
        name: 'home',
        component: homeLayout,
        children: [
          {
            path: '/Home',
            name: 'home',
            component: () => import(/* webpackChunkName: "about" */ '../views/Home/index.vue')
          },
          {
            path: '/Home/Competence',
            name: 'Competence',
            component: () => import(/* webpackChunkName: "about" */ '../views/Home/Competence.vue')
          },
          {
            path: '/Home/Information',
            name: 'Information',
            component: () => import(/* webpackChunkName: "about" */ '../views/Information/index.vue')
          },
          {
            path: '/Home/InformationDetail',
            name: 'Detail',
            component: () => import(/* webpackChunkName: "about" */ '../views/Information/detail.vue')
          },
        ]
      },
      {
        path: '/Enterprise',
        name: 'Enterprise',
        component: () => import(/* webpackChunkName: "about" */ '../views/Enterprise/Index.vue')
      },
      {
        path: '/Playgroup',
        name: 'Playgroup',
        component: () => import(/* webpackChunkName: "about" */ '../views/Playgroup/Index.vue')
      },
      {
        path: '/Personal',
        name: 'Personal',
        component: () => import(/* webpackChunkName: "about" */ '../views/Personal/Index.vue')
      },
      {
        path: '/Base',
        name: 'Base',
        component: () => import(/* webpackChunkName: "about" */ '../views/BaseResources/Index.vue')
      },
      {
        path: '/about',
        name: 'About',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/About/Index.vue')
      }
    ]
  },

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
